﻿Public Class FrmTimKiemTheoSoPhieu
    Sub Tim()
        Dim sophieu As TimKiemSoPhieu_DTO = New TimKiemSoPhieu_DTO
        sophieu.sophieu = txtSoPhieuTim.Text
        If (rdoPhieuXuat.Checked = True) Then
            dgvChiTietPhieuNhapXuatDonHang.DataSource = TimKiemSoPhieu_DAO.selectBySoPhieuXuat(sophieu)
        Else
            dgvChiTietPhieuNhapXuatDonHang.DataSource = TimKiemSoPhieu_DAO.selectBySoPhieuNhap(sophieu)
        End If
    End Sub

    Private Sub btnTimDH_Click(sender As Object, e As EventArgs) Handles btnTimDH.Click
        Tim()
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Me.Close()
    End Sub

   
    Private Sub dgvChiTietPhieuNhapXuatDonHang_SelectionChanged(sender As Object, e As EventArgs) Handles dgvChiTietPhieuNhapXuatDonHang.SelectionChanged
        If (dgvChiTietPhieuNhapXuatDonHang.SelectedRows.Count > 0) Then
            Dim sophieu As String = dgvChiTietPhieuNhapXuatDonHang.SelectedRows(0).Cells(0).Value.ToString()

            dgvTimDonHang.DataSource = CapNhatPhieuNhapKho_DAO.SelectBySP(sophieu)
        End If

    End Sub


End Class